package com.tj.collection.controller.chatquality.response;

import com.tj.collection.db.domain.RptModelDataPreDayDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

@ApiModel(value = "modelVO", description = "model信息类")
@Data
@Builder
public class ModelVO implements Serializable {

    /**
     *
     */
    private String chatterUserCode;
    /**
     *
     */
    private String chatterAccount;
    /**
     *
     */
    private String chatterName;
    /**
     *
     */
    private String modelName;
    @ApiModelProperty("统计日期")
    private Integer createDt;
    @ApiModelProperty("model名称")
    private String modelNickName;
    @ApiModelProperty("MID")
    private String modelUserCode;
    @ApiModelProperty("model like率")
    private String modelLikeRate;
    @ApiModelProperty("新客建联数")
    private Integer newContactNum;
    @ApiModelProperty("新客承接数")
    private Integer newMatchNum;
    @ApiModelProperty("新客承接率")
    private String newMatchRate;
    @ApiModelProperty("新客发送消息数")
    private Integer sendMsgNumOfNewAccount;
    @ApiModelProperty("回复消息数")
    private Integer replyMsgNum;
    @ApiModelProperty("回复饱和度")
    private String replyPercent;
    @ApiModelProperty("排班时间内及时回复率")
    private String replyRateInWorkingTimes;
    @ApiModelProperty("新客破冰会话数")
    private Integer iceBreakerNum;
    @ApiModelProperty("新客破冰会话率")
    private String iceBreakerRate;
    @ApiModelProperty("新客有效会话数")
    private Integer validChatNum;
    @ApiModelProperty("新客有效会话率")
    private String validChatRate;
    @ApiModelProperty("新客深度会话数")
    private Integer deepChatNum;
    @ApiModelProperty("新客深度会话率")
    private String deepChatRate;
    @ApiModelProperty("给老客打招呼数(人)")
    private Integer sayHiToOldAccountNum;
    @ApiModelProperty("老客回复数(人)")
    private Integer replyFromOldAccount;
    @ApiModelProperty("回复老客数(人)")
    private Integer replyToOldAccountFromModel;
    @ApiModelProperty("沟通老客总数")
    private Integer totalNumOfOldAccount;
    @ApiModelProperty("给老客消息发送总数")
    private Integer totalNumToOldAccountFromModel;
    @ApiModelProperty("pp卖出次数")
    private Integer totalPrivatePhotosNum;
    @ApiModelProperty("pv卖出次数")
    private Integer totalPrivateVideosNum;
    @ApiModelProperty("非会员第一个解锁数")
    private Integer totalUnlockWithNoneVIP;

    public static ModelVO toVo(RptModelDataPreDayDto dto) {
        if (dto == null) {
            return ModelVO.builder().build();
        }
        return ModelVO.builder().chatterAccount(dto.getChatterAccount()).chatterName(dto.getChatterName()).chatterUserCode(dto.getChatterUserCode())
                .modelName(dto.getModelName()).modelUserCode(dto.getModelUserCode()).createDt(dto.getCreateDt()).modelLikeRate(dto.getCurrentModelLikeRate())
                .newContactNum(dto.getNewContactNum()).newMatchNum(dto.getNewMatchAcceptanceNum()).newMatchRate(dto.getNewMatchAcceptanceRate()).sendMsgNumOfNewAccount(dto.getNewSendNum()).replyMsgNum(dto.getReplyNum())
                .replyPercent(dto.getReplyPercentRate()).replyRateInWorkingTimes(dto.getTimelyReplyInWorkingHourRate()).iceBreakerNum(dto.getNewIceBreakerChatsNum()).iceBreakerRate(dto.getNewIceBreakerChatsRate())
                .validChatNum(dto.getNewValidChatsNum()).validChatRate(dto.getNewValidChatsRate()).deepChatNum(dto.getNewDeepChatsNum()).deepChatRate(dto.getNewDeepChatsRate())
                .sayHiToOldAccountNum(dto.getGreetingToOldNum()).replyFromOldAccount(dto.getReplyFromOldNum()).replyToOldAccountFromModel(dto.getRepliedToOldNum())
                .totalNumOfOldAccount(dto.getTotalChatSessionForOldNum()).totalNumToOldAccountFromModel(dto.getTotalMessagesForOldNum()).totalPrivatePhotosNum(dto.getTotalPpNum())
                .totalPrivateVideosNum(dto.getTotalPvNum()).totalUnlockWithNoneVIP(dto.getFirstUnlockWithNoneVipNum()).build();
    }
}
